<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>角色管理</title>
    <meta name="description" content="这是一个角色管理页面">
    <meta name="keywords" content="角色管理">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="${contextPath}/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="${contextPath}/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="${contextPath}/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="${contextPath}/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="${contextPath}/assets/css/app.css">
    <script src="${contextPath}/assets/js/jquery.min.js"></script>

</head>

<body data-type="widgets">
    <script src="${contextPath}/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <#include "/pc/common/header.html">
        <!-- 侧边导航栏 -->
        <#include "/pc/common/left.html">
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <ol class="am-breadcrumb widget-head">
                                <li><a href="${contextPath}/index.htm" class="am-icon-home">首页</a></li>
                                <li>系统管理</li>
                                <li>角色管理</li>
                                <div class="am-btn-group-xs" style="float: right">
                                <a href="${contextPath}/role/modify.htm" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</a>
                                </div>
                            </ol>
                            <div class="widget-body  am-fr">
                                <div class="am-u-sm-12">
                                    <div class="am-form-group" style="float: right">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">

                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="am-u-sm-12">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black am-text-nowrap am-scrollable-horizontal am-table-centered" id="example-r">
                                        <thead>
                                            <tr>
                                                <th>角色排序</th>
                                                <th>角色名称</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <#list page as l>
                                            <#if l.sjid=1>
                                            <tr class="gradeX">
                                                <td>${l.orders}</td>
                                                <td>${l.mc}</td>
                                                <td>
                                                    <div class="tpl-table-black-operation">
                                                        <a href="${contextPath}/role/modify.htm?jsid=${l.id}">
                                                            <i class="am-icon-pencil"></i> 修改
                                                        </a>
                                                        <a href="${contextPath}/role/qxtree.htm?jsid=${l.id}" class="tpl-table-black-operation-change">
                                                            <i class="am-icon-user"></i> 权限
                                                        </a>
                                                        <#if l.id!=2 && l.id!=3 && l.id!=4>
                                                        <a href="javascript:;" class="tpl-table-black-operation-del" onclick="del_b('${l.id}')">
                                                            <i class="am-icon-trash"></i> 删除
                                                        </a>
                                                        </#if>
                                                    </div>
                                                </td>
                                            </tr>
                                            </#if>
                                        </#list>
                                        </tbody>
                                    </table>
                                </div>
                                <#include "/pc/common/page.html">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <#include "/pc/common/alert.html" />
    <script src="${contextPath}/assets/js/amazeui.min.js"></script>
    <script src="${contextPath}/assets/js/amazeui.datatables.min.js"></script>
    <script src="${contextPath}/assets/js/dataTables.responsive.min.js"></script>
    <script src="${contextPath}/assets/js/amazeui.page.js"></script>
    <script src="${contextPath}/assets/js/app.js"></script>
    <script>
        var del_b = function(id){
            Mconfirm("你确定要删除这条记录吗？",function(){
                $.ajax({
                    url:"${contextPath}/role/del.htm?jsid="+id,
                    type:"get",
                    dataType:"json",
                    success:function(data){
                        var json = $.parseJSON(data);
                        Malert(json.errMessage,function(){
                            location.reload();
                        });
                    }
                });
            })
        };
    </script>
</body>

</html>